import router from '@/router'
import avatar from '@/assets/avatar.png'
export default {
  namespaced: true,
  state: {
    token: '',
    userName: '',
    avatar
  },
  getters: {
  },
  mutations: {
    setUserInfo (state, paylod) {
      state.token = 'Mikanpaper'
      state.userName = 'admin'
    },
    userLogout (state) {
      state.token = ''
      state.userName = ''
    }
  },
  actions: {
    userLogin (context) {
      context.commit('setUserInfo')
      router.push('/dashboard')
    }
  }
}
